class CreateShops < ActiveRecord::Migration[5.2]
  def change
    create_table :shops do |t|
      t.string :name
      t.string :phone
      t.string :avatar
      t.integer :level, default: 0
      t.integer :province_id
      t.integer :city_id
      t.integer :district_id
      t.boolean :direct_sale, default: false
      t.string :contact_name
      t.string :contact_phone
      t.string :big_avatar
      t.integer :sales_percent, default: 0
      t.string :bank_account_name
      t.string :bank
      t.string :bank_account
      t.integer :shop_type_id
      t.decimal :balance, :precision => 10, :scale => 2, :default => 0.0, comment: "结余"
      t.integer :stars, default: 1
      t.integer :state, default: 0
      t.string :idcard_front
      t.string :idcard_back
      t.string :license
      t.integer :unread_shop_notifications_count, default: 0
      t.float :distance
      t.float :longitude
      t.float :latitude
      t.string :address
      t.text :intro

      t.timestamps
    end
  end
end
